<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title><?php echo $title;?></title>
<meta name="description" content="<?php echo isset($metapage['description'])? $metapage['description'] :'Norton universt,College of Science, Department of Computer Studies.';?>">
<meta name="keywords" content="<?php echo isset($metapage['keyword'])? $metapage['keyword'] :'Norton universt,College of Science, Department of Computer Studies.';?>">
<link href="<?php echo base_url();?>css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo base_url();?>js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/script.js"></script>
<script type="text/javascript"> 
   
</script>  
</head>
<body>
   <div id="wrapper">
    <div id="top">
    	<div class="account">
    		<?php 
    		if (isset($_SESSION['uid']) && $_SESSION['uid'] > 0 && $_SESSION['role_id']!=1) {
				echo '<img title="setting" class="setting" src="'.base_url().'css/images/setting.png" />';
    			echo "Welcome, ".$_SESSION['username'];
    			//echo anchor("cmemberlogin/logout","Logout");
    			$this->load->view('site/setting');
    		} else {?>
    			<!--  <a class="lable-login" href="#">Member Login</a>-->
    			<?php //$this->load->view('site/login');?>
    			<?php echo anchor("cmemberlogin/login","Member Login");?>
    		<?php } ?>
    	</div>
    </div>
	<div id="header">
		<div class="building">
			
		</div>
		<a href="<?php echo base_url();?>"><img src="<?php echo base_url();?>css/images/logo2.png" alt="logo" /></a>
	</div>
	<div id="menu-nav">
		<div id="nav">
			<ul><?php
				$frontPages = $this->MPage->getAllActivePages();
				if ( count($frontPages) )
				{
					$homepage = 1;
					foreach ($frontPages as $key => $list)
					{
						$pageloop = base_url().uri_string();
						$subpage = base_url().'page/details/';
						$home = substr($pageloop, strlen($subpage));
						
						if ( (substr($pageloop, strlen($subpage)) == $list['path']) || ($homepage == 1 && $home == '') )
							$class = 'current';
						else $class = '';
						
						// hide border right if it is the last menu item
						if ( count($frontPages) == $homepage ) $id = "last";
						else $id = "";
						$submenu = $this->MPage->getActiveSubPages($list['page_id']);
						$parent = '';
						if ( count($submenu) )
						{
							$parent = 'parent';
						}
						echo '<li id="'.$id.'" class="'.$class.'  '.$parent.'">'.anchor("page/details/".$list['path'], $list['name']);
							if ( count($submenu) )
							{
								echo '<div class="submenu"><ul>';
								foreach ($submenu as $newkey => $item)
								{
									echo '<li>'.anchor("page/details/".$item['path'],$item['name']).'</li>';
								}
								echo '</ul></div>';
							}
						echo '</li>';
						$pageloop += 1;
						$homepage += 1;
					}
				}?>
			</ul>
		</div>
	</div>
    <div class="bg-top"></div>
    
    <!-- Slideshow -->
    <?php 
    	if(isset($slideshow)){
    		$this->load->view($slideshow);
    	}
    ?>
    <!-- End Slideshow -->
    
	<div id="content-container">
			<?php 
				$margin_left = "";
				if (isset($left)) {
					echo '<div id="content-left">';
					$margin_left = "content-margin-left";
					$this->load->view($left);	
					echo '</div>'; 
				}
			?>
        	<?php 
        		$margin_right = "";
				if (isset($right)) {
					echo '<div id="content-right">';
					$margin_right = "content-margin-right";
					$this->load->view($right);
					echo '</div>';	
				}
			?>
		<div id="content-main" class="<?php echo $margin_left.'  '.$margin_right;?>">
            <?php $this->load->view($main);?>
        </div>
		<div style="clear:both;"></div>
	</div>
	<div id="footer">
		<!-- <div class="copy">
			<ul>
				<li><?php //echo anchor("welcome/page","Contact Us"); ?>&nbsp;|&nbsp;</li>
				<li><?php //echo anchor("welcome/page","Privacy Policy"); ?></li>
			</ul>
			<p>&copy;2012, All Rights Reserved by Norton university - deparment: computer study.</p>
		</div>
		 -->
		 <p>
		 	NORTON UNIVERSITY<BR/>
		 	College of Science, Department of Computer Studies.
		 </p>
	</div>
</div>
</body>
</html>
